<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p>账号：<input type="text" id="user"></p>
    <p>密码：<input type="text" id="psw"></p>
    <p><button id="btn">登录</button></p>
</body>
<script src="./axios.js"></script>
<script>
    const  user=document.getElementById('user');
    const  psw=document.getElementById('psw');
    const  btn=document.getElementById('btn');
    btn.addEventListener('click',()=>{
        axios.post('/login',{
            userName:user.value,
            passWord:psw.value,
        }).then(res=>{
            console.log(res);
        })
    })
</script>
</html>